namespace java.swift thrift.test.service
namespace cpp test
namespace java thrift.test.client.thrifty
namespace py test.thrift


enum EnumTest {
  HELLO,
  WORLD
}

exception TestException {
  1: optional string message;
  2: optional string causeClass;
  3: optional string serviceStackTraceMessage;
  4: optional string causeFields;
}

exception ServiceRuntimeException {
  1: optional string message;
  2: optional string causeClass;
  3: optional string serviceStackTraceMessage;
  4: optional string causeFields;
  5: required i32 type;
}

struct TestBeanA {
  1: optional binary binaryArray;
  2: optional list<i32> intArray;
  3: optional list<i32> intList;
  4: optional list<i64> longList;
  5: required bool _new;
  6: optional double rate;
  7: optional list<string> urls;
  8: optional map<string, i64> values;
}

struct TestBeanB {
  1: optional binary buffer;
  2: optional list<i32> intArray;
  3: optional map<string, i64> values;
  4: optional set<double> doubleList;
}

service TestInterface {
  binary byteTest(1: optional binary input) throws (1: TestException ex1, 2: ServiceRuntimeException ex2);
  list<TestBeanA> testArray(1: optional list<i64> input) throws (1: ServiceRuntimeException ex1);
  TestBeanA testBean(1: optional TestBeanB input) throws (1: ServiceRuntimeException ex1);
  EnumTest testEnum(1: optional EnumTest input) throws (1: ServiceRuntimeException ex1);
  double testFloat(1: optional double input) throws (1: ServiceRuntimeException ex1);
  double testList(1: optional string strInput, 2: required i32 intInput, 3: optional i64 dateInput, 4: optional binary binaryArray, 5: optional i64 longInput) throws (1: ServiceRuntimeException ex1);
  list<i32> testList2(1: optional map<i64, TestBeanA> input) throws (1: ServiceRuntimeException ex1);
  list<i32> testThriftStruct(1: optional set<TestBeanB> input) throws (1: ServiceRuntimeException ex1);
  list<string> testURIURL(1: optional string input) throws (1: ServiceRuntimeException ex1);
  list<string> testURIURLUrlUrl(1: optional string input) throws (1: ServiceRuntimeException ex1);
  void testVoid(1: required i32 input) throws (1: ServiceRuntimeException ex1);
}
